Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

otelslog: Split code attributes #6415

Merged
merged 5 commits into from
Dec 11, 2024
Merged

Conversation

pellared
Copy link
Member

@pellared pellared commented Dec 10, 2024

Follow semantic conventions more strictly. See the following thread: open-telemetry/semantic-conventions#1624 (comment)

Follows #6253

There is no noticeable performance overhead:

goos: linux
goarch: amd64
pkg: go.opentelemetry.io/contrib/bridges/otelslog
cpu: Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
                               │   old.txt    │               new.txt               │
                               │    sec/op    │   sec/op     vs base                │
Handler/(WithSource).Handle-16   260.4n ± 21%   234.0n ± 5%  -10.14% (p=0.035 n=10)

                               │  old.txt   │            new.txt             │
                               │    B/op    │    B/op     vs base            │
Handler/(WithSource).Handle-16   248.0 ± 0%   248.0 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

                               │  old.txt   │            new.txt             │
                               │ allocs/op  │ allocs/op   vs base            │
Handler/(WithSource).Handle-16   2.000 ± 0%   2.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

Planning to do the same for otelzap.

@pellared pellared requested review from MrAlias and a team as code owners December 10, 2024 09:18
@pellared pellared added the bridge: slog Related to the slog bridge label Dec 10, 2024
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.8%. Comparing base (8e19210) to head (9f5ef5b).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #6415   +/-   ##
=====================================
  Coverage   67.8%   67.8%           
=====================================
  Files        200     200           
  Lines      16589   16597    +8     
=====================================
+ Hits       11251   11262   +11     
+ Misses      4995    4993    -2     
+ Partials     343     342    -1     
Files with missing lines Coverage Δ
bridges/otelslog/handler.go 93.3% <100.0%> (+0.2%) ⬆️

... and 1 file with indirect coverage changes

@pellared
Copy link
Member Author

@Jesse0Michael, PTAL as author of #6253

@MrAlias, PTAL as code owner of otelslog.

@pellared pellared added this to the v1.33.0 milestone Dec 10, 2024
Copy link
Contributor

@Jesse0Michael Jesse0Michael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pellared pellared merged commit 0abc931 into open-telemetry:main Dec 11, 2024
26 checks passed
@pellared pellared deleted the code-attrs branch December 11, 2024 07:10
pellared added a commit that referenced this pull request Dec 12, 2024
MrAlias added a commit that referenced this pull request Dec 12, 2024
### Added

- Added support for providing `endpoint`, `pollingIntervalMs` and
`initialSamplingRate` using environment variable
`OTEL_TRACES_SAMPLER_ARG` in
`go.opentelemetry.io/contrib/samples/jaegerremote`. (#6310)
- Added support exporting logs via OTLP over gRPC in
`go.opentelemetry.io/contrib/config`. (#6340)
- The `go.opentelemetry.io/contrib/bridges/otellogr` module.
This module provides an OpenTelemetry logging bridge for
`github.com/go-logr/logr`. (#6386)
- Added SNS instrumentation in
`go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws`.
(#6388)

### Changed

- Change the span name to be `GET /path` so it complies with the OTel
HTTP semantic conventions in
`go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho`.
(#6365)
- Record errors instead of setting the `gin.errors` attribute in
`go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin`.
(#6346)
- The `go.opentelemetry.io/contrib/config` now supports multiple schemas
in subdirectories (i.e. `go.opentelemetry.io/contrib/config/v0.3.0`) for
easier migration. (#6412)

### Fixed

- Fix broken AWS presigned URLs when using instrumentation in
`go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws`.
(#5975)
- Fixed the value for configuring the OTLP exporter to use `grpc`
instead of `grpc/protobuf` in `go.opentelemetry.io/contrib/config`.
(#6338)
- Allow marshaling types in `go.opentelemetry.io/contrib/config`.
(#6347)
- Removed the redundant handling of panic from the `HTML` function in
`go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin`.
(#6373)
- The `code.function` attribute emitted by
`go.opentelemetry.io/contrib/bridges/otelslog` now stores just the
function name instead the package path-qualified function name. The
`code.namespace` attribute now stores the package path. (#6415)
- The `code.function` attribute emitted by
`go.opentelemetry.io/contrib/bridges/otelzap` now stores just the
function name instead the package path-qualified function name. The
`code.namespace` attribute now stores the package path. (#6423)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridge: slog Related to the slog bridge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants